﻿using Himp.Outpatient.HttpApi;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;

namespace Himp.Outpatient.V1
{
    /// <summary>
    /// 门诊支付方式
    /// </summary>
    [Area(OutpatientRemoteServiceConsts.ModuleName)]
    [RemoteService(Name = OutpatientRemoteServiceConsts.RemoteServiceName)]
    [Route("api/outpatient/v1/otpPayWay")]
    [ApiVersion("1")]
    [ApiController]
    [ControllerName("otpPayWay")]
    public class OtpPayWayController : OutpatientController
    {
        private IOtpPayWayService _otpPayWayService;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="otpPayWayService"></param>
        public OtpPayWayController(IOtpPayWayService otpPayWayService)
        {
            _otpPayWayService = otpPayWayService;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<OtpPayWayDto> PostAsync([FromBody]OtpPayWayCreateDto request)
        {
            var recvTime = DateTime.Now.ToString("yyyyMMddHHmmss");
            return await _otpPayWayService.CreateAsync(request);
        }

        [HttpDelete]
        [Route("{id}")]
        public async Task DeleteAsync([FromRoute]Guid id)
        {
            var recvTime = DateTime.Now.ToString("yyyyMMddHHmmss");
            await _otpPayWayService.DeleteAsync(id);
        }
    }
}
